package com.hzhq.contract.bean.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.bson.types.ObjectId;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.DBRef;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

/**
 * @author hzhq
 * @create 2021/4/7 5:12 下午
 * @email hzhq1255@163.com
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Document(collection = "user_role")
public class UserRole {

    @Id
    private ObjectId id;
    @ApiModelProperty(value = "用户")
    @Field("user")
    @DBRef
    private User user;
    @ApiModelProperty(value = "角色")
    @Field("role")
    @DBRef
    private Role role;
    @ApiModelProperty(value = "授权人系统管理员")
    @DBRef
    @Field("admin")
    private Admin admin;
    @ApiModelProperty(value = "授予时间")
    @Field("assign_time")
    private Date assignTime;
    @ApiModelProperty("是否删除")
    @Field("deleted")
    private Integer deleted;
    @ApiModelProperty("是否通过")
    @Field("passed")
    private Integer passed;


}
